<?php

namespace api\supersession;

class SuperSession {

	public function __set($var, $value) {
		apc_store($var, $value);
	}

	public function __get($var) {
		return apc_fetch($var);
	}
	
	public function __isset($var) {
		$return = apc_exists($var);
		
		if(is_array($var)) {
			return (count($return) != 0) ? true : false;
		} else {
			return $return;
		}
	}
	
	public function __unset($var) {
		apc_delete($var);
	}
}